package com.yupi.cli.command;

import cn.hutool.core.util.ReflectUtil;
import com.yupi.model.MainTemplateConfig;
import picocli.CommandLine;

import java.lang.reflect.Field;

/**
 * 输出允许用户传入的动态参数的信息
 */
@CommandLine.Command(name = "config", description = "查看参数谢谢", mixinStandardHelpOptions = true)
public class ConfigCommand implements Runnable {
    @Override
    public void run() {
        //获取类的所有字段
        Field[] fields = ReflectUtil.getFields(MainTemplateConfig.class);
        //循环打印获取的字段
        for(Field field : fields){
            System.out.print("字段名称：" + field.getName());
            System.out.print("\t");
            System.out.println("字段类型：" + field.getType());
        }
    }
}
